/*
 * @Author: your name
 * @Date: 2021-10-13 14:30:56
 * @LastEditTime: 2021-10-30 10:13:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /egg_dome/config/config.default.js
 */
/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1634106652910_6054';

  // add your middleware config here
  config.middleware = ['checktoken'];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  config.security = {
    csrf: {
        enable: false, 
    },
  };

  // 第三方登陆需要的id（密钥）
  config.userInfo = {
    client_id: 'e4a37a464d56585b58297b67799f92090c28158a4ca44ee0b19c33166d0efd27',
    client_secret: '99528bab0a5e360dc6719ef2a348f7f2967b8ac5c16d2c017b14e14970d48d47',
    redirect_uri: 'http://localhost:8080/login'
  }

  config.cors = {
    origin: "*", 
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
  };

  config.jwt = {secret:"zhuxiaodong"}

  return {
    ...config,
    ...userConfig,
  };
};
